package com.example.common.exception;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 异常错误码
 *
 * @author sunyong
 * @date 2021/1/15
 */
@AllArgsConstructor
@Getter
public enum ExceptionCode {
    // 预留1000-30000
    FORBIDDEN(403, "无访问权限"), SERVER_ERROR(500, "服务器内部错误")

    // 通用
    , PARAM_MISS(1000, "参数缺失"), PARAM_NOT_VALID(1001, "不合法的参数"), DATA_EXIST(1002, "数据已存在"), DATA_NOT_EXIST(1003, "数据不存在"), REPEAT_REQUEST(1004, "重复操作"), REQUEST_FAILED(1005, "操作失败"), EMPTY_DATA(1006, "数据加载完毕"), ILLEGAL_REQ(1007, "非法访问");

    private int code;
    private String msg;
}
